package com.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import de.greenrobot.dao.AbstractDaoMaster;
import de.greenrobot.dao.identityscope.IdentityScopeType;

import com.dao.AgendaDao;
import com.dao.ApiarioDao;
import com.dao.ApiarioFloraDao;
import com.dao.ApicultorDao;
import com.dao.AssociacoesDao;
import com.dao.ClassificasaoDao;
import com.dao.CodeIneDao;
import com.dao.CriaRainhasDao;
import com.dao.EstradosDao;
import com.dao.ExameDao;
import com.dao.FloraDao;
import com.dao.FormaAlimentacaoDao;
import com.dao.GrauDefesaDao;
import com.dao.GruposDao;
import com.dao.GruposActivDao;
import com.dao.HistoricoDao;
import com.dao.ManutencoesDao;
import com.dao.ManutencoescolmDao;
import com.dao.MedicamentosDao;
import com.dao.MelgueirasDao;
import com.dao.MesesDao;
import com.dao.MetodosCriacaoDao;
import com.dao.MetodosIntroDao;
import com.dao.MotivoTrocaDao;
import com.dao.NacionalidadesDao;
import com.dao.NiveisReservasDao;
import com.dao.PragasDao;
import com.dao.QualidMelDao;
import com.dao.RacasDao;
import com.dao.RainhasDao;
import com.dao.RegAlimentacoesDao;
import com.dao.RegEnxamesDao;
import com.dao.RegPragasDao;
import com.dao.TipoAlimentacaoDao;
import com.dao.TipoColmeiaDao;
import com.dao.TiposExitenciaFloresDao;
import com.dao.TiposOrigemDao;
import com.dao.TiposIntervencaoDao;
import com.dao.TrocasCeraDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * Master of DAO (schema version 1): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
    public static final int SCHEMA_VERSION = 1;

    /** Creates underlying database table using DAOs. */
    public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
        AgendaDao.createTable(db, ifNotExists);
        ApiarioDao.createTable(db, ifNotExists);
        ApiarioFloraDao.createTable(db, ifNotExists);
        ApicultorDao.createTable(db, ifNotExists);
        AssociacoesDao.createTable(db, ifNotExists);
        ClassificasaoDao.createTable(db, ifNotExists);
        CodeIneDao.createTable(db, ifNotExists);
        CriaRainhasDao.createTable(db, ifNotExists);
        EstradosDao.createTable(db, ifNotExists);
        ExameDao.createTable(db, ifNotExists);
        FloraDao.createTable(db, ifNotExists);
        FormaAlimentacaoDao.createTable(db, ifNotExists);
        GrauDefesaDao.createTable(db, ifNotExists);
        GruposDao.createTable(db, ifNotExists);
        GruposActivDao.createTable(db, ifNotExists);
        HistoricoDao.createTable(db, ifNotExists);
        ManutencoesDao.createTable(db, ifNotExists);
        ManutencoescolmDao.createTable(db, ifNotExists);
        MedicamentosDao.createTable(db, ifNotExists);
        MelgueirasDao.createTable(db, ifNotExists);
        MesesDao.createTable(db, ifNotExists);
        MetodosCriacaoDao.createTable(db, ifNotExists);
        MetodosIntroDao.createTable(db, ifNotExists);
        MotivoTrocaDao.createTable(db, ifNotExists);
        NacionalidadesDao.createTable(db, ifNotExists);
        NiveisReservasDao.createTable(db, ifNotExists);
        PragasDao.createTable(db, ifNotExists);
        QualidMelDao.createTable(db, ifNotExists);
        RacasDao.createTable(db, ifNotExists);
        RainhasDao.createTable(db, ifNotExists);
        RegAlimentacoesDao.createTable(db, ifNotExists);
        RegEnxamesDao.createTable(db, ifNotExists);
        RegPragasDao.createTable(db, ifNotExists);
        TipoAlimentacaoDao.createTable(db, ifNotExists);
        TipoColmeiaDao.createTable(db, ifNotExists);
        TiposExitenciaFloresDao.createTable(db, ifNotExists);
        TiposOrigemDao.createTable(db, ifNotExists);
        TiposIntervencaoDao.createTable(db, ifNotExists);
        TrocasCeraDao.createTable(db, ifNotExists);
    }
    
    /** Drops underlying database table using DAOs. */
    public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
        AgendaDao.dropTable(db, ifExists);
        ApiarioDao.dropTable(db, ifExists);
        ApiarioFloraDao.dropTable(db, ifExists);
        ApicultorDao.dropTable(db, ifExists);
        AssociacoesDao.dropTable(db, ifExists);
        ClassificasaoDao.dropTable(db, ifExists);
        CodeIneDao.dropTable(db, ifExists);
        CriaRainhasDao.dropTable(db, ifExists);
        EstradosDao.dropTable(db, ifExists);
        ExameDao.dropTable(db, ifExists);
        FloraDao.dropTable(db, ifExists);
        FormaAlimentacaoDao.dropTable(db, ifExists);
        GrauDefesaDao.dropTable(db, ifExists);
        GruposDao.dropTable(db, ifExists);
        GruposActivDao.dropTable(db, ifExists);
        HistoricoDao.dropTable(db, ifExists);
        ManutencoesDao.dropTable(db, ifExists);
        ManutencoescolmDao.dropTable(db, ifExists);
        MedicamentosDao.dropTable(db, ifExists);
        MelgueirasDao.dropTable(db, ifExists);
        MesesDao.dropTable(db, ifExists);
        MetodosCriacaoDao.dropTable(db, ifExists);
        MetodosIntroDao.dropTable(db, ifExists);
        MotivoTrocaDao.dropTable(db, ifExists);
        NacionalidadesDao.dropTable(db, ifExists);
        NiveisReservasDao.dropTable(db, ifExists);
        PragasDao.dropTable(db, ifExists);
        QualidMelDao.dropTable(db, ifExists);
        RacasDao.dropTable(db, ifExists);
        RainhasDao.dropTable(db, ifExists);
        RegAlimentacoesDao.dropTable(db, ifExists);
        RegEnxamesDao.dropTable(db, ifExists);
        RegPragasDao.dropTable(db, ifExists);
        TipoAlimentacaoDao.dropTable(db, ifExists);
        TipoColmeiaDao.dropTable(db, ifExists);
        TiposExitenciaFloresDao.dropTable(db, ifExists);
        TiposOrigemDao.dropTable(db, ifExists);
        TiposIntervencaoDao.dropTable(db, ifExists);
        TrocasCeraDao.dropTable(db, ifExists);
    }
    
    public static abstract class OpenHelper extends SQLiteOpenHelper {

        public OpenHelper(Context context, String name, CursorFactory factory) {
            super(context, name, factory, SCHEMA_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
            createAllTables(db, false);
        }
    }
    
    /** WARNING: Drops all table on Upgrade! Use only during development. */
    public static class DevOpenHelper extends OpenHelper {
        public DevOpenHelper(Context context, String name, CursorFactory factory) {
            super(context, name, factory);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
            dropAllTables(db, true);
            onCreate(db);
        }
    }

    public DaoMaster(SQLiteDatabase db) {
        super(db, SCHEMA_VERSION);
        registerDaoClass(AgendaDao.class);
        registerDaoClass(ApiarioDao.class);
        registerDaoClass(ApiarioFloraDao.class);
        registerDaoClass(ApicultorDao.class);
        registerDaoClass(AssociacoesDao.class);
        registerDaoClass(ClassificasaoDao.class);
        registerDaoClass(CodeIneDao.class);
        registerDaoClass(CriaRainhasDao.class);
        registerDaoClass(EstradosDao.class);
        registerDaoClass(ExameDao.class);
        registerDaoClass(FloraDao.class);
        registerDaoClass(FormaAlimentacaoDao.class);
        registerDaoClass(GrauDefesaDao.class);
        registerDaoClass(GruposDao.class);
        registerDaoClass(GruposActivDao.class);
        registerDaoClass(HistoricoDao.class);
        registerDaoClass(ManutencoesDao.class);
        registerDaoClass(ManutencoescolmDao.class);
        registerDaoClass(MedicamentosDao.class);
        registerDaoClass(MelgueirasDao.class);
        registerDaoClass(MesesDao.class);
        registerDaoClass(MetodosCriacaoDao.class);
        registerDaoClass(MetodosIntroDao.class);
        registerDaoClass(MotivoTrocaDao.class);
        registerDaoClass(NacionalidadesDao.class);
        registerDaoClass(NiveisReservasDao.class);
        registerDaoClass(PragasDao.class);
        registerDaoClass(QualidMelDao.class);
        registerDaoClass(RacasDao.class);
        registerDaoClass(RainhasDao.class);
        registerDaoClass(RegAlimentacoesDao.class);
        registerDaoClass(RegEnxamesDao.class);
        registerDaoClass(RegPragasDao.class);
        registerDaoClass(TipoAlimentacaoDao.class);
        registerDaoClass(TipoColmeiaDao.class);
        registerDaoClass(TiposExitenciaFloresDao.class);
        registerDaoClass(TiposOrigemDao.class);
        registerDaoClass(TiposIntervencaoDao.class);
        registerDaoClass(TrocasCeraDao.class);
    }
    
    public DaoSession newSession() {
        return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
    }
    
    public DaoSession newSession(IdentityScopeType type) {
        return new DaoSession(db, type, daoConfigMap);
    }
    
}
